-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove redundant eval trigger #36433
base: release
Are you sure you want to change the base?
Conversation
WalkthroughThe recent changes involve the removal of the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
Recent review detailsConfiguration used: .coderabbit.yaml Files selected for processing (1)
Additional comments not posted (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Outside diff range and nitpick comments (1)
app/client/src/pages/AppViewer/index.tsx (1)
Alright, class, gather 'round! We've got some interesting results from our experiment. It looks like our
setupPublishedPage
function is still present in various parts of our codebase. Let's break down our findings:Attention, developer! Our investigation reveals that
setupPublishedPage
is still alive and kicking in our codebase.Here's what we've discovered:
setupPublishedPage
appears in multiple files, including:
- app/client/src/entities/Engine/AppViewerEngine.ts
- app/client/src/actions/pageActions.tsx
- app/client/src/ce/sagas/PageSagas.tsx
- There's also a related saga called
setupPublishedPageSaga
.- Our test files (PageSaga.test.ts) are importing and using
setupPublishedPageSaga
.Now, class, here's your homework assignment:
- Carefully review these occurrences to ensure your changes don't introduce any unintended side effects.
- Double-check if the removal of the
setupPublishedPage
dispatch in the file we initially reviewed was intentional.- Consider whether the other occurrences of
setupPublishedPage
should be updated to maintain consistency across the codebase.Remember, in software development, just like in science, every change can have ripple effects. It's crucial to understand the full scope of our actions!
Analysis chain
Line range hint
91-94
: Great job simplifying the page resource fetching logic!Removing the dispatch of
setupPublishedPage
action and only dispatchingfetchPublishedPageResourcesAction
with thebasePageId
argument streamlines the code and aligns with the PR objective of eliminating redundant evaluation triggers. This change enhances code clarity and maintainability.To ensure this change doesn't introduce any unintended consequences, please run the following script to verify that
setupPublishedPage
is no longer used in the codebase:
Class, it seems we've encountered a small hiccup in our investigation. Our previous attempt to search for
setupPublishedPage
didn't quite work as expected. But don't worry! In the spirit of scientific inquiry, we're going to try a different approach. Let's modify our experiment and run it again.Now, class, let's run this improved experiment and see what results we get. Remember, in science, it's all about refining our methods until we get the answers we're looking for!
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `setupPublishedPage` is no longer used in the codebase. # Test: Search for occurrences of `setupPublishedPage`. Expect: No occurrences found. rg --type typescript $'setupPublishedPage'Length of output: 76
Script:
#!/bin/bash # Description: Verify that `setupPublishedPage` is no longer used in the codebase. # Test 1: Search for occurrences of `setupPublishedPage` in .ts and .tsx files echo "Searching for 'setupPublishedPage' in .ts and .tsx files:" rg 'setupPublishedPage' --glob '*.{ts,tsx}' # Test 2: Search for potential imports of setupPublishedPage echo "Searching for potential imports of 'setupPublishedPage':" rg 'import.*setupPublishedPage' --glob '*.{ts,tsx}'Length of output: 1296
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (5)
- app/client/src/actions/pageActions.tsx (0 hunks)
- app/client/src/ce/sagas/PageSagas.tsx (4 hunks)
- app/client/src/ce/sagas/tests/PageSaga.test.ts (0 hunks)
- app/client/src/entities/Engine/AppViewerEngine.ts (1 hunks)
- app/client/src/pages/AppViewer/index.tsx (1 hunks)
Files not reviewed due to no reviewable changes (2)
- app/client/src/actions/pageActions.tsx
- app/client/src/ce/sagas/tests/PageSaga.test.ts
Additional comments not posted (2)
app/client/src/entities/Engine/AppViewerEngine.ts (1)
108-108
: Excellent work simplifying thesetupPublishedPage
call!Class, I must commend the developer for streamlining the invocation of the
setupPublishedPage
function. By eliminating the superfluous third argument, you have not only made the code more concise but also improved its readability. This change demonstrates a keen eye for detail and a commitment to writing clean, efficient code. Well done!app/client/src/pages/AppViewer/index.tsx (1)
31-31
: Excellent work importing the necessary action!The
fetchPublishedPageResourcesAction
is imported correctly from theactions/pageActions
module. This follows the best practice of placing import statements at the top of the file. Well done!
const canvasWidgetsPayload = getCanvasWidgetsPayload(response); | ||
|
||
// resize main canvas | ||
resizePublishedMainCanvasToLowestWidget(canvasWidgetsPayload.widgets); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to use 'yield' when calling functions inside generator functions
In the updateCanvasLayout
generator function, the call to resizePublishedMainCanvasToLowestWidget
should be yielded to properly handle side effects within the generator.
Apply this diff to fix the issue:
- resizePublishedMainCanvasToLowestWidget(canvasWidgetsPayload.widgets);
+ yield call(resizePublishedMainCanvasToLowestWidget, canvasWidgetsPayload.widgets);
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
resizePublishedMainCanvasToLowestWidget(canvasWidgetsPayload.widgets); | |
yield call(resizePublishedMainCanvasToLowestWidget, canvasWidgetsPayload.widgets); |
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10960635688. |
Deploy-Preview-URL: https://ce-36433.dp.appsmith.com |
Description
Fixes #36237
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Caution
🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10965434213
Commit: ba66e4e
Cypress dashboard.
Tags: @tag.All
Spec:
The following are new failures, please fix them before merging the PR:
Fri, 20 Sep 2024 21:03:00 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
PageSagas
for better readability and performance.Tests
firstLoad
property from action payloads.